function fixPagesHeight() {
    if($(window).width()>750){
       $('.swiper-slide,.swiper-container,html,body,.swiper-wrapper').css({height: $(window).height(),width:$(window).height()*750/1334});
}  else{
    $('.swiper-slide,.swiper-container').css({height: $(window).height()});
}
  
}
$(window).on('resize', function () {
    fixPagesHeight();
});
fixPagesHeight();
var mySwiper = new Swiper('.swiper-container', {
    direction: 'vertical',
    lazyLoading: true,
    mousewheelControl: true,
    watchSlidesProgress: true,
    observer: true, //修改swiper自己或子元素时，自动初始化swiper  
    observeParents: true, //修改swiper的父元素时，自动初始化swiper  
    onInit: function (swiper) {
        swiper.myactive = 0;
        swiperAnimateCache(swiper); //隐藏动画元素 
        swiperAnimate(swiper); //初始化完成开始动画
    },
    onSlideChangeEnd: function (swiper) {
        swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
    }
    ,
    onProgress: function (swiper) {
        for (var i = 0; i < swiper.slides.length; i++) {
            var slide = swiper.slides[i];
            var progress = slide.progress;
            var translate, boxShadow;

            translate = progress * swiper.height * 0.8;
            scale = 1 - Math.min(Math.abs(progress * 0.2), 1);
            boxShadowOpacity = 0;

            slide.style.boxShadow = '0px 0px 10px rgba(0,0,0,' + boxShadowOpacity + ')';

            if (i === swiper.myactive) {
                es = slide.style;
                es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = 'translate3d(0,' + (translate) + 'px,0) scale(' + scale + ')';
                es.zIndex = 0;
            } else {
                es = slide.style;
                es.webkitTransform = es.MsTransform = es.msTransform = es.MozTransform = es.OTransform = es.transform = '';
                es.zIndex = 1;
            }
        }
    },
    onTransitionEnd: function (swiper, speed) {
        for (var i = 0; i < swiper.slides.length; i++) {
        }
        swiper.myactive = swiper.activeIndex;
    },
    onSetTransition: function (swiper, speed) {
        for (var i = 0; i < swiper.slides.length; i++) {
            es = swiper.slides[i].style;
            es.webkitTransitionDuration = es.MsTransitionDuration = es.msTransitionDuration = es.MozTransitionDuration = es.OTransitionDuration = es.transitionDuration = speed + 'ms';

        }
    }
});

//点击立刻下载判断终端
$(".lkxz").click(function () {
    var u = navigator.userAgent, app = navigator.appVersion;
    alert(u);
    //ios 终端
    if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
        alert(u);
        var ua = u.toLowerCase();
        if (ua.indexOf('micromessenger') > -1) {

        } else {
            window.location = "https://www.baidu.com";
        }
    }
//Android终端
    if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) {
        alert(u);
        var ua = u.toLowerCase();
        if (ua.indexOf('micromessenger') > -1) {

        } else {
            window.location = "https://www.baidu.com";
        }
    }
})





